package cn.test.user.api;

import cn.test.user.api.mock.UserServiceMock;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @auther hanchao
 * @date 2017/1/23 11:35
 */
@FeignClient(value = "user-service",fallback = UserServiceMock.class)
public interface UserService {
    /**
     * 和之前自己用javassist实现的一样，对于接口的参数名未获取，所以需要显示用注解声明
     * ibatis也是一样
     */
    @RequestMapping(method= RequestMethod.GET,value="/users/add")
    Integer add(@RequestParam("a") int a,@RequestParam("b") int b);
}
